﻿{include file="public/header"}

<title>订单列表</title>
</head>
<style>
    .layui-layer-page .layui-layer-content {
        overflow: visible !important;
    }

</style>
<body>
<nav class="breadcrumb">

    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
       href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
</nav>
<div class="page-container">
    <form method="get">
        <div class="text-c ">
            创建时间:
            <input type="text" name="start_time" id="countTimestart" onfocus="selecttime(1)" size="17"
                   class="date input-text " readonly style="width:100px"
                   value="{$data['start_time'] ?? ''}">
            -
            <input type="text" name="end_time" id="countTimeend" onfocus="selecttime(2)" size="17"
                   class="date input-text" readonly style="width:100px"
                   value="{$data['end_time'] ?? ''}">
            <span class="select-box inline" style="border: none">
		<select name="status" class="form-control">
			<option value="">订单进度</option>
            <option value="20"  <?php if( isset($data['status']) && $data["status"]==20){?> selected="selected" <?php }?>>待指派</option>
            <option value="1" <?php if( isset($data['status']) && $data["status"]==1){?> selected="selected" <?php }?>>待接单</option>
            <option value="2" <?php if( isset($data['status']) && $data["status"]==2){?> selected="selected" <?php }?>>待上门</option>
            <option value="3" <?php if( isset($data['status']) && $data["status"]==3){?> selected="selected" <?php }?>>待签约</option>
            <option value="5"<?php if( isset($data['status']) && $data["status"]==5){?> selected="selected" <?php }?>>施工中</option>
            <option value="7" <?php if( isset($data['status']) && $data["status"]==7){?> selected="selected" <?php }?>>已完工</option>
            <option value="6" <?php if( isset($data['status']) && $data["status"]==6){?> selected="selected" <?php }?>>已完成</option>
            <option value="8" <?php if( isset($data['status']) && $data["status"]==8){?> selected="selected" <?php }?>>已取消</option>
            <option value="9" <?php if( isset($data['status']) && $data["status"]==9){?> selected="selected" <?php }?>>退单</option>
            <option value="10" <?php if( isset($data['status']) && $data["status"]==10){?> selected="selected" <?php }?>>无效订单</option>

        </select>
            </span>
            <span class="select-box inline">
		<select name="channel_id" class="select">
			<option value="" selected>订单来源</option>
            {volist name='p' id='v'}
            <option value="{$v.id}" <?php if( isset($data['channel_id']) && $data["channel_id"]==$v['id']){?> selected="selected" <?php }?>>{$v.title}</option>
       {/volist}

		</select>

		</span>


            <span class="select-box inline">
		<select name="store_id" class="select">
			<option value="" selected>分店</option>
            {volist name='l' id='v'}
            <option value="{$v.store_id}"  <?php if( isset($data['store_id']) && $data["store_id"]==$v['store_id']){?> selected="selected" <?php }?>>{$v.store_name}</option>
       {/volist}

		</select>

		</span>

            <!--<span class="select-box inline" style="border: none">-->
		<!--<select class="form-control" name="full">-->
            <!--<option value="">介绍满意度</option>-->
             <!--<option value=" ">请选择</option>-->
                    <!--<option value="十分愿意" <?php if( isset($data['full']) && $data["full"]=="十分愿意"){?> selected="selected" <?php }?>>十分愿意</option>-->
                    <!--<option value="有可能" <?php if( isset($data['full']) && $data["full"]=="有可能"){?> selected="selected" <?php }?>>有可能</option>-->
                    <!--<option value="不愿意" <?php if( isset($data['full']) && $data["full"]=="不愿意"){?> selected="selected" <?php }?>>不愿意</option>-->

                <!--</select>-->
            <!--</span>-->

            <!--<span class="select-box inline" style="border: none">-->
		 <!--<input type="text" name="remote_time" id="countTimeends" onfocus="selecttime(3)" size="17"-->
                <!--class="date form-control" readonly style="width:180px"-->
                <!--value="{$data['remote_time'] ?? ''}" placeholder="下次跟进时间">-->
            <!--</span>-->

            <!--<span class="select-box inline" style="border: none">-->
		<!--<select class="form-control" name="remote">-->
            <!--<option value="" selected>跟进状态</option>-->
           <!--{volist name='r' id='v'}-->
            <!--<option value="{$v.title}" <?php if( isset($data['remote']) && $data["remote"]==$v['title']){?> selected="selected" <?php }?> >{$v.title}</option>-->
       <!--{/volist}-->

                <!--</select>-->
            <!--</span>-->

            <span class="select-box inline" style="border: none">
		<select name="chen" class="form-control" style="float: left;width: 40%;padding: 3px">
			<option value="">搜索名称</option>
            <option value="contacts" <?php if( isset($data['chen']) && $data["chen"]=='contacts'){?> selected="selected" <?php }?>>姓名</option>
            <option value="telephone" <?php if( isset($data['chen']) && $data["chen"]=='telephone'){?> selected="selected" <?php }?>>联系方式</option>
            <option value="order_no" <?php if( isset($data['chen']) && $data["chen"]=='order_no'){?> selected="selected" <?php }?>>订单编号</option>
            <option value="addres" <?php if( isset($data['chen']) && $data["chen"]=='addres'){?> selected="selected" <?php }?>>地址</option>
        </select>

        <input type="text" name="contacts" placeholder="" style="width:128px;float: right"
               class="input-text form-control">
		</span>

            <!--<span class="select-box inline" style="border: none">-->
		 <!--<select name="city_id" class="form-control" style="float: left;width: 39%;padding: 3px">-->
                <!--<option value="">搜索城市</option>-->
 <!--<option value="">搜索城市</option>-->
                <!--{volist name='city' id='v'}-->
                <!--<option value="{$v.city_id}" <?php if( isset($data['city_id']) && $data["city_id"]==$v['city_id']){?> selected="selected" <?php }?> >{$v.city}</option>-->
                <!--{/volist}-->
            <!--</select>-->
            <!--<input type="text" name="assignor" placeholder="接单人" style="width:128px" class="input-text  form-control" value="{$data['assignor'] ?? ''}">-->
            <!--</span>-->


            <span class="select-box inline" style="border: none">

            <input type="text" name="addres" placeholder="请输入小区地址" style="width:128px" class="input-text  form-control" value="{$data['addres'] ?? ''}">
            </span>
            <span class="select-box inline" style="border: none">

            <input type="text" name="management" placeholder="推荐人" style="width:128px" class="input-text  form-control" value="{$data['management'] ?? ''}">
            </span>
            <span class="select-box inline">

          <select name="residential_id" class="select">
			<option value="" selected>物业公司</option>
            {volist name='ls' id='v'}
            <option value="{$v.username}" <?php if(isset($data['group_id']) && $data["group_id"]==$v['username']){?> selected="selected" <?php }?> >{$v.username}</option>
       {/volist}

		</select>
            </span>

            <button class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>

        </div>

    </form>
    {if condition="$node.rule=='*' || $admin.admin_id==4 || $admin.admin_id ==68 || $admin.admin_id==43 ||
    $admin.export==1"}

    <a href="{:Url('index/Export/orderOriginal')}?start_time={$data['start_time'] ?? ''}&end_time={$data['end_time'] ?? ''}&status={$data['status'] ?? ''}&city_id={$data['city_id'] ?? ''}&assignor={$data['assignor'] ?? ''}&store_id={$data['store_id'] ?? ''}&channel_id={$data['channel_id'] ?? ''}&full={$data['full'] ?? ''}&residential_id={$data['residential_id'] ?? ''}&remote_time={$data['remote_time'] ?? ''}&remote={$data['remote'] ?? ''}&chen={$data['chen'] ?? ''}&contacts={$data['contacts'] ?? ''}&addres={$data['addres'] ?? ''}&management={$data['management'] ?? ''}" style="text-decoration:none" class="ml-5 dao" title="导出"><span
            class="label label-primary">导出</span></a>
    {/if}
    <div class="mt-20">
        <div class="title-border" style="font-size: 11px">
            <div class="flex5">城市</div>
            <div class="flex10">订单编号</div>
            <div class="flex10 ">下单时间</div>
            <div class="flex5 ">渠道一级</div>
            <div class="flex5">渠道二级</div>
            <div class="flex5">一级类别</div>
            <div class="flex5">二级类别</div>
            <div class="flex7">联系人</div>
            {if condition="$hide == 2"}
            <div class="flex10 ">联系方式</div>
            {/if}
            <div class="flex10 ">地址</div>
            <div class="flex6 ">订单状态</div>
            <div class="flex6 ">取消原因</div>
            <div class="flex7">上门时间</div>
            <div class="flex6 ">是否有效</div>
            <div class="flex8 ">接单人</div>
            <div class="flex4 ">店铺</div>
            <div class="flex4 ">打分</div>
            <div class="flex4 ">满意度</div>
            <div class="flex10 ">内容</div>
            <div class="flex10 ">不满意</div>
            <div class="flex4 ">最好的地方</div>
            <div class="flex5">报价金额</div>
            <div class="flex4 ">推荐人</div>
            <div class="flex4 ">小区名称</div>
            <div class="flex4 ">所属物业</div>
            {volist name='lists' id='vo'}
            <div class="flex4 ">{$vo.title}</div>
            <div class="flex4 ">{$vo.name}</div>
            <div class="flex10 ">{$vo.remake}</div>
            <div class="flex6 ">{$vo.time}</div>
            {/volist}
        </div>
        {volist name='list' id='vo'}
        <div class="content-border" style="font-size: 11px">
            <div class="flex5">{$vo.city}</div>
            <div class="flex10">{$vo.order_no}</div>
            <div class="flex10">{$vo.created_time}</div>
            <div class="flex5">{$vo.title}</div>
            <div class="flex5 ">{$vo.channel_detailsTitle}</div>
            <div class="flex5">{$vo.problemTitle}</div>
            <div class="flex5">{$vo.problemTitle1}</div>
            <div class="flex7">{$vo.contacts}</div>
            {if condition="$hide == 2"}
            <div class="flex10">{$vo.telephone}</div>
            {/if}
            <div class="flex10">{$vo.addres}</div>
            <div class="flex6">{$vo.states}</div>
            <div class="flex6">{$vo.reason}</div>
            <div class="flex7">{$vo.planned}</div>
            <div class="flex6">{$vo.you}</div>
            <div class="flex8">{$vo.namekl}</div>
            <div class="flex4">{$vo.store_name}</div>
            <div class="flex4">{$vo.score}</div>
            <div class="flex4">{$vo.full}</div>
            <div class="flex10">{$vo.content3}</div>
            <div class="flex10">{$vo.dissatisfied}</div>
            <div class="flex4">{$vo.best}</div>
            <div class="flex5">{$vo.turnover}</div>
            <div class="flex4">{$vo.management}</div>
            <div class="flex4">{$vo.residential_quarters}</div>
            <div class="flex4">{$vo.content1}</div>
            <div class="flex4"> <?php  echo empty($vo['through'][0]['roles'])?'':$vo['through'][0]['roles'];?></div>
            <div class="flex4"> <?php echo empty($vo['through'][0]['username'])?'':$vo['through'][0]['username'];?></div>
            <div class="flex10"> <?php echo empty($vo['through'][0]['remar'])?'':$vo['through'][0]['remar'];?></div>
            <div class="flex6"> <?php echo empty($vo['through'][0]['th_time'])?'':$vo['through'][0]['th_time'];?></div>
            <div class="flex4"> <?php echo empty($vo['through'][1]['roles'])?'':$vo['through'][1]['roles'];?></div>
            <div class="flex4"> <?php echo empty($vo['through'][1]['username'])?'':$vo['through'][1]['username'];?></div>
            <div class="flex10"> <?php echo empty($vo['through'][1]['remar'])?'':$vo['through'][1]['remar'];?></div>
            <div class="flex6"> <?php echo empty($vo['through'][1]['th_time'])?'':$vo['through'][1]['th_time'];?></div>


        </div>
        {/volist}
        <div class="pages" style="float: right">{$list->render()}</div>

    </div>
    <div class="ch-more">
        <div class="ch-more-white">
            <div class="ch-more-content">

            </div>
            <div class="ch-more-off"></div>
        </div>
    </div>
</div>

{include file="public/footer"}
<script type="text/javascript">


    function selecttime(flag) {
        if (flag == 1) {
            var endTime = $("#countTimeend").val();
            if (endTime != "") {
                WdatePicker({dateFmt: 'yyyy-MM-dd', maxDate: endTime})
            } else {
                WdatePicker({dateFmt: 'yyyy-MM-dd'})
            }
        } else if (flag == 2) {
            var startTime = $("#countTimestart").val();
            if (startTime != "") {
                WdatePicker({dateFmt: 'yyyy-MM-dd', minDate: startTime})
            } else {
                WdatePicker({dateFmt: 'yyyy-MM-dd'})
            }
        } else {
            WdatePicker({dateFmt: 'yyyy-MM-dd'})
        }
    }

    $('.page-container').on('click', '.info', function () {
        var id = $(this).attr('data-id');
        var src = "{:Url('index/order/info')}";
        var index = layer.open({
            type: 2,
            area: ['100%', '100%'],
            fix: false,
            shade: 0.4,
            title: '订单详情',
            content: src + '?order_id=' + id
        });
        layer.full(index);
    });

    $('.page-container').on('click', '.info1', function () {
        var id = $(this).attr('data-id');
        var src = "{:Url('index/Statistics/info')}";
        var index = layer.open({
            type: 2,
            area: ['100%', '100%'],
            fix: false,
            shade: 0.4,
            title: '订单详情',
            content: src + '?order_id=' + id
        });
        layer.full(index);
    });
    /**
     * 编辑
     */
    $('.page-container').on('click', '.edit', function () {
        var winWidth = $(window).width();
        var areaWidth = "";
        var areaHeight = "";
        if (winWidth > 768) {
            areaWidth = "800px"
            areaHeight = "600px"
        } else {
            areaWidth = '100%'
            areaHeight = '100%'
        }
        var id = $(this).attr('data-id');
        var src = "{:Url('index/order/edit')}";
        layer.open({
            type: 2,
            area: [areaWidth, areaHeight],
            scrollbar: false,//屏蔽浏览器滚动条
            shade: 0.4,
            title: '订单编辑',
            zIndex: layer.zIndex,
            content: src + '?order_id=' + id,
            success: function (layero, index) {
                layer.iframeAuto(index);
            }
        });
    });

    /**
     * 导出
     */
    function downloadFile() {
        var dom = document.getElementById('ifile');
        dom.src = "{:Url('index/Statistics/download')}";
    }

</script>

<script>
    $(function () {
        for (var i = 0; i < $(".more").length; i++) {
            (function (index) {
                $(".more").eq(index).on("click", function () {
                    console.log(123)
                    var moreStr = '';
                    $(".ch-more-content").html("");
                    var cont = $(".content-border").eq(index).children("div");
                    var tit = $(".title-border").children("div");
                    var contArr = [];
                    var titArr = [];
                    for (var j = 0; j < cont.length; j++) {
                        if (cont.eq(j).html() != "") {
                            contArr.push(cont.eq(j).html())
                            titArr.push(tit.eq(j).html())
                        }
                    }
                    titArr.splice(-1, 1);
                    contArr.splice(-2, 1);
                    for (var l = 0; l < titArr.length; l++) {
                        if (l != titArr.length - 1) {
                            moreStr += `
                            <div class="ch-more-row"><p>${titArr[l]}：</p><p>${contArr[l]}</p></div>
                            `
                        } else {
                            moreStr += `<div class="ch-more-row-button">${contArr[l]}</div>`
                        }
                    }
                    $(".ch-more-content").append(moreStr);
                    $(".ch-more").css({"opacity": "1", "z-index": "10000"});
                    $(".ch-more-white").css({
                        "transform": "scale(1)",
                        "margin-top": ($(window).height() - $(".ch-more-white").height()) / 2
                    });
                })
            })(i)
        }
        $(".ch-more-off").on("click", function () {
            $(".ch-more").css({"opacity": "0", "z-index": "-1"});
            $(".ch-more-white").css("transform", "scale(0)");
        })
        $(".ch-more").on('click', '.ch-more-row-button a', function () {
            $(".ch-more").css({"opacity": "0", "z-index": "-1"});
            $(".ch-more-white").css("transform", "scale(0)");
        })
    })
</script>


</body>
</html>
